package com.kucai.yifaqapp.widget;

import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.kucai.yifaqapp.R;

import org.w3c.dom.Text;

public class Activity_Zhongjiang extends Activity {
    private ImageView weizhongjiang;
    private String bonus;
    private String level;
    private RelativeLayout zhongjiang;
    private TextView dengjiang;
    private TextView price;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_zhongjiang);
        getWindow().setLayout(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
        Intent intent = getIntent();
        level = intent.getStringExtra("level");
        bonus = intent.getStringExtra("bonus");
        weizhongjiang = findViewById(R.id.weizhongjiang);
        zhongjiang = findViewById(R.id.zhongjiang);
        dengjiang = findViewById(R.id.dengjiang);
        price = findViewById(R.id.price);

        if (!TextUtils.isEmpty(level)) {
            weizhongjiang.setVisibility(View.GONE);
            zhongjiang.setVisibility(View.VISIBLE);
            dengjiang.setText("恭喜获得" + level + "等奖");
            price.setText("共计" + bonus + "元");
        }


        weizhongjiang.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        zhongjiang.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}
